﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search" Title="猎书网-搜索结果" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script language="javascript" src="/model/List.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){   
//选择按钮 
    $("#clearAll,#clearAll2").bind("click", function(e){
       $("[name='checkbox']").removeAttr("checked");
    });
//入库按钮
    $("#add, #add2").bind("click", function(e){
       var bookids="";
       $("[name='checkbox']").each(function(){
            if($(this).attr("checked"))
                if(bookids=="")
                    bookids+=$(this).val();
                else
                    bookids+="_"+$(this).val();
                $(this).removeAttr("checked");
       });
       if(bookids!=""){
            $.ajax({ 
                url: 'MyBook.aspx',
                type: 'POST',
                data: { lb: "add", bookid:bookids},
                dataType: 'html',
                timeout: 1000,
                error: function() { $("#result,#result2").text("未知错误!"); },
                success: function(data) { 
                    $("#result,#result2").text(data);
                    if(data=="尚未登录")
                        window.location="/Login.aspx";       
            }
            }); 
        }
    });
});   
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="left comment"><% Response.Write(WebMake.getSearchState(Request));%></div>
<form name="myForm" id="myForm" action="#" method="post">
<div class="left"><input type="button" value="清除选择" id="clearAll" name="clearAll" />&nbsp;&nbsp;<input type="button" name="add" id="add"  value="加入书架" /><label id="result" class="comment"></label></div>
<table cellspacing="0" cellpadding="0" class="myTable">
<tr>
    <th width="5%">选中</th>
    <th width="5%">状态</th>
    <th width="10%">类型</th>
    <th width="20%">书名</th>
    <th width="10%">作者</th>
    <th width="40%">最新章节</th>
    <th width="10%">人气指数</th>
</tr>
<% Response.Write(WebMake.getBookSearch(Request));%>
</table>
<div class="left"><input type="button" value="清除选择" id="clearAll2" name="clearAll2" />&nbsp;&nbsp;<input type="button" name="add2" id="add2"  value="加入书架" /><label id="result2" class="comment"></label></div>
</form>
</asp:Content>

